# -*- coding:utf-8 -*-

from selenium.webdriver.common.by import By

from PageClass.fscIndexPageClass.fscIndexPage import FscIndexPage
from Util import logger


class CashierAuditPage(FscIndexPage):

    def __init__(self, driver):
        super().__init__(driver)

    _selectBoeNum = (By.ID, 'undefined_boeNo_LK')

    def input_selectBoeNum(self, text):
        self.send_text(text, *self._selectBoeNum)
        logger.info(f'输入查询的任务单据编号为：{text}')

    # 查询
    def click_selectButton(self):
        super().click_selectButton()

    _selectResult = (By.XPATH, '//*[@id="app"]/section/section/main/div/div/div[2]/div'
                               '/div[3]/div/div[3]/div/div[2]/table[1]/tbody/tr')

    def click_selectResult(self):
        self.click(*self._selectResult)
        logger.info("点击查询结果")
        self.switchToCurrentWindow()

    def click_auditButton(self):
        self.click_button('审核')
        logger.info("点击审核按钮")

    def click_submitButton(self):
        self.click_button('提交')
        logger.info("点击提交按钮")
